/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.csm.csmstaffhelper;

/**
 *
 * @author exception
 */
public class StaffLevel {
    private Integer level1;

    private Integer level2;

    private Integer level3;

    public StaffLevel(Integer level1, Integer level2, Integer level3) {
        this.level1 = level1;
        this.level2 = level2;
        this.level3 = level3;
    }

    public StaffLevel(Integer[] levels) {
        this.level1 = levels[0];
        this.level2 = levels[1];
        this.level3 = levels[2];
    }

    public int compareTo(StaffLevel level, Boolean stricted) {
        if(stricted == true) {
            if(this.getLevel1().equals(level.getLevel1()) && this.getLevel2().equals(level.getLevel2()) && this.getLevel3().equals(level.getLevel3())) {
                return 1;
            } else {
                return -1;
            }
        } else {
            if(this.getLevel1() < level.getLevel1()) {
                return -1;
            }

            if(this.getLevel2() < level.getLevel2()) {
                return -1;
            }

            if(this.getLevel3() < level.getLevel3()) {
                return -1;
            }

            return 1;
        }
    }

    @Override
    public String toString() {
        return "Levels : " + getLevel1() + " " + getLevel2() + " " + getLevel3();
    }

    /**
     * @return the level1
     */
    public Integer getLevel1() {
        return level1;
    }

    /**
     * @return the level2
     */
    public Integer getLevel2() {
        return level2;
    }

    /**
     * @return the level3
     */
    public Integer getLevel3() {
        return level3;
    }
}
